import request from '@/utils/request'

// 查询项目列表
export function listProject(query) {
  let url_add = "";
  if(query==2){
    url_add = "/project/getLoginUserList"
  }
  else if(query==1){
    url_add = "/project/getAgencyList"
  }
  return request({
    url: url_add,
    method: 'get',
  })
}

// 新增项目
export function addProject(data) {
  return request({
    url: '/project',
    method: 'post',
    data: data
  })
}

// 查询项目详细
export function getProject(data) {
  return request({
    url: '/project/'+data,
    method: 'get'
  })
}

// 修改项目
export function updateProject(data) {
  return request({
    url: '/project',
    method: 'put',
    data: data
  })
}


// 删除项目
export function delProject(data) {
  return request({
    url: '/project/'+data,
    method: 'delete'
  })
}


// 查询分区列表
export function listZone(query) {
  return request({
    url: '/prozone/getListPage',
    method: 'get',
    params: query
  })
}
//删除分区
export function delZone(data){
  return request({
    url:'/prozone/'+data,
    method:'delete',
  })
}

// 新增分区
export function addProZone(data) {
  return request({
    url: '/prozone',
    method: 'post',
    data: data
  })
}

// 查询分区详细
export function getProZone(data) {
  return request({
    url: '/prozone/'+data,
    method: 'get'
  })
}

// 修改分区信息
export function updateProZone(data) {
  return request({
    url: '/prozone',
    method: 'put',
    data: data
  })
}
//获取任务详细
export function getZoneTask(data) {
  return request({
    url: '/zotask/'+data,
    method: 'get'
  })
}
//方法设计
export function updateProZoneTask(data){
  return request({
    url: '/pzTaskAssign/assign',
    method: 'put',
    data: data
  })
}
//获取任务
export function getMethods(id){
  return request({
    url: '/pzTaskAssign/'+id,
    method: 'get',
  })
}

//历史相关信息==================
//获取场地活动信息
export function getActivity(query){
  return request({
    url: '/projectActivity/getActivitys',
    method: 'get',
    params:query
  })
}
//获取场地污染情况
export function getEmission(query){
  return request({
    url: 'projectEmission/getEmissions',
    method: 'get',
    params:query
  })
}
//获取场地排污位置情况表
export function getEmissionPosition(id){
  return request({
    url: '/pzTaskAssign/'+id,
    method: 'get',
  })
}
//获取场地环境事件
export function getEvent(query){
  return request({
    url: '/projectEvent/getExents',
    method: 'get',
    params:query
  })
}
//获取场地历史信息
export function getHistory(query){
  return request({
    url: '/projectHistory/getHistorys',
    method: 'get',
    params:query
  })
}
//获取场地历史图片
export function getHistoryPic(query){
  return request({
    url: '/proHistoryPic/getHistoryPics',
    method: 'get',
    params:query
  })
}
//获取场地修复事件
export function getremediation(query){
  return request({
    url: '/projectRemediation/getRemediations',
    method: 'get',
    params:query
  })
}
//获取场地文件信息
export function getFile(id){
  return request({
    url: '/pzTaskAssign/'+id,
    method: 'get',
  })
}